{:W('Cate/header')}
{:W('Cate/left')}
<!--内容部分-->
<div class="content">
    <div class="title">
        <p>账号总览</p>
        <i class="icon-angle-right"></i>
        <p class="active">账户总览</p>
    </div>
    <div style="width:100%;padding:0 10px;">
        <div class="main_title2">
            <ul class="clearfix">
                <li>
                    <if condition="$userinfo['userrole'] eq '1'">
                    <span>{$userinfo.companyname}</span> / 客户名称
                    <else/>
                    <span>{$areaname}</span> / 区域名称
                    </if>
                <if condition="$userinfo['userrole'] eq '1'">
                    <li>
                        <em style="color:#1181cd;">{$userinfo.contact}</em> / 联系人
                    </li>
                    <li>
                        <em style="color:#1181cd;">{$userinfo.tel}</em> / 联系电话
                        <img id="add_bj" src="__PUBLIC__/images/xiugai.png">
                    </li>
                </if>
            </ul>
        </div>
    </div>
    <div class="admin_list clearfix">
        <div class="main">
            <div class="main_list_menu">
                <if condition="$userinfo['userrole'] eq '1'">
                    <a href="javascript:;" class="active">企业用户详情</a>
                <else/>
                <a href="javascript:;" class="active">区域用户详情</a>
                </if>
            </div>
            <div class="main_list">
                <div class="regional_img" id="analysis" style="height: 400px;"></div>
            </div>
        </div>
    </div>
</div>
<if condition="$userinfo['userrole'] eq '1'">
<!--添加子组织-->
<div class="hk"></div>
<div class="add_group">
    <div class="add_group_title">
        <img src="__PUBLIC__/images/i_guanbi.png" class="icon-remove">修改联系人信息
    </div>
    <div class="add_group_center">
        <ul>
            <li>
                    <span>
                        <i>*</i>联系人 :
                        </span>
                <input value="{$userinfo.contact}" name="contact" maxlength="10" type="text">
            </li>
            <li>
                    <span>
                        <i>*</i>联系方式 :
                        </span>
                <input value="{$userinfo.tel}" name="tel" maxlength="11" type="text">
            </li>
        </ul>
    </div>
    <div class="add_group_btn">
        <button>确定</button>
        <button>取消</button>
    </div>
</div>
    <script type="text/javascript">
        $(document).ready(function () {
            getPopup($('#add_bj'),$('.add_group'));
            // 编辑用户信息
            $('.add_group button').eq(0).on('click',function(){
                var _conf = {
                    username:$('.add_group input[name="contact"]').val(),
                    tel:$('.add_group input[name="tel"]').val(),
                };
                if(!$.trim(_conf['username'])){
                    layer.msg('请输入联系人！',{icon:2,time:2000});
                    return false;
                }
                var _check =  /^1\d{10}$/;
                if(!_check.test(_conf['tel'])){
                    layer.msg('手机号格式错误！',{icon:2,time:2000});
                    return false;
                }
                $.post("{:U('account_overview/ModifyContact_post')}",_conf,function(data){
                    if(data.result == '0'){
                        layer.msg('编辑用户成功！',{icon:1,time:2000});
                        $('.main_title2 em').eq(0).text(_conf['username']);
                        $('.main_title2 em').eq(1).text(_conf['tel']);
                        close();
                    } else {
                      layer.msg(data.msg,{icon:2,time:2000});
                    }
                })
            })
        })
    </script>
</if>
</body>
<script type="text/javascript" src="__PUBLIC__/js/echarts.common.min.js"></script>
<script>
    var MyEchart = echarts.init(document.getElementById('analysis'));
    // 折线图
    option = {
        title: {
            text: '<?php echo $title; ?>',
            left: 'center',
        },
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data:['累计用户','新增用户'],
            y: 'bottom',
        },
        xAxis:  {    // 放Y轴数据
            type: 'category',
            boundaryGap: false,
            data: <?php echo $date; ?>
        },
        yAxis: {
            type: 'value',
            max: <?php echo $max; ?>,
            axisLabel: {
                formatter: '{value}'   // 单位
            }
        },
        series: [
            {
                name:'累计用户',
                type:'line',
                data: <?php echo $totaluser; ?>,
                label:{
                    normal:{
                        show:true,
                    }
                }
            },
            {
                name:'新增用户',
                type:'line',
                data: <?php echo $newuser; ?>,
                label:{
                    normal:{
                        show:true,
                    }
                }
            }
        ]
    };
    MyEchart.setOption(option);
</script>
</html>